Bug 1983736 - Patch jsonschema to work with Python 3.14+ r=mach-reviewers,ahal,ahochh...
authorJan-Erik Rediger <jrediger@mozilla.com>
Wed, 27 Aug 2025 01:09:58 +0000 (01:09 +0000)
committerMike Hommey <glandium@debian.org>
Wed, 2 Sep 2026 01:31:33 +0000 (10:31 +0900)
Differential Revision: https://phabricator.services.mozilla.com/D262335

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1983736-Patch-jsonschema-to-work-with-Python-3.1.patch

python/mozbuild/mozbuild/vendor/vendor_python.py
third_party/python/jsonschema/jsonschema/validators.py

index 9acee946fc4c8332c19379eaf525cfa1642b9758..2801e1b685d51db1e0c3991513515f85850c6c97 100644 (file)
@@ -40,6 +40,10 @@ EXCLUDED_PACKAGES = {
     # modified 'dummy' version of it so that the dependency checks still succeed, but
     # if it ever is attempted to be used, it will fail gracefully.
     "ansicon",
+    # jsonschema 4.17.3 is incompatible with Python 3.14+,
+    # but later versions use a dependency with Rust components, which we thus can't vendor.
+    # For now we apply the minimal patch to jsonschema to make it work again.
+    "jsonschema",
 }
 
 
index 66e803ea2d0bf32395744d00ccd5e4c5e71e59ff..88316a8bb727e0238b3e93d69bd57b94fdb7ffd7 100644 (file)
@@ -875,8 +875,11 @@ class RefResolver:
             return None
         uri, fragment = urldefrag(url)
         for subschema in subschemas:
+            id = subschema["$id"]
+            if not isinstance(id, str):
+                continue
             target_uri = self._urljoin_cache(
-                self.resolution_scope, subschema["$id"],
+                self.resolution_scope, id,
             )
             if target_uri.rstrip("/") == uri.rstrip("/"):
                 if fragment: